import axios from 'axios';
import Cookies from 'js-cookie';
import React from 'react';

const TOKEN = Cookies.get('csrfToken');
let instance = TOKEN ? axios.create({
  headers: {
    'x-csrf-token': TOKEN
  }
}) : axios;
//登录注册接口
export const UserApi = {
  loginIn(options) {
    return instance.post('/api/v1/login', options);
  },
  AddUser(options) {
    return instance.post('/api/v1/registeruser', options)
  },
  getNormalUsers(options) {
    return instance.post('/api/v1/getnormalusers', options)
  },
  delUser(options) {
    return instance.post("/api/v1/deluser",options)
  },
  editUserPassWord(options){
    return instance.post("/api/v1/edituserpassword",options)
  }
};

